﻿@page "/employee"
@using System.Diagnostics
@inject HttpClient HttpClient
@inject NavigationManager NavigationManager

<h3>Employee</h3>
<div>
    <MudDataGrid Items="@Employees" >
        <Columns>
            <Column T="MudBlazorTemplates1.Models.Employee" Field="Id"></Column>
            <Column T="MudBlazorTemplates1.Models.Employee" Field="Name"></Column>
            @*<Column></Column>*@
        </Columns>
    </MudDataGrid>

</div>

@code {

    List<MudBlazorTemplates1.Models.Employee> Employees { get; set; } = new();

    protected override async Task OnInitializedAsync()
    {
        Employees = await HttpClient.GetFromJsonAsync<List<MudBlazorTemplates1.Models.Employee>>($"{NavigationManager.BaseUri}api/Employees");
    }

    

}
